UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6yyQUVTyKllu3CyJivb3B2gJ1RNliLFqTeut1Ci5rls='
WHERE
key_id = '0f77bca4882f666bf4eb2abdfbf90704f0cf88a6b19a5f0d79f2bd423634b943'
AND (
token = '6yyQUVTyKllu3CyJivb3B2gJ1RNliLFqTeut1Ci5rls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)