UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EUKZWP7PWo3La+CFPYV5crm2MF3jwY3unECXV7h8tD4='
WHERE
key_id = 'ac98b0bf25f8a6744bf4c7392f151a5c234c0649f7fe1f7fa2843033de51c49c'
AND (
token = 'EUKZWP7PWo3La+CFPYV5crm2MF3jwY3unECXV7h8tD4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)