UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n2CWuytKS0eFRA8ToGJEArz9B1KpM1J/ifppU0YdS3o='
WHERE
key_id = '5c411242fe3b34d5e4164ff00b6b1d87305d54690b30b741613d4b384b51c91d'
AND (
token = 'n2CWuytKS0eFRA8ToGJEArz9B1KpM1J/ifppU0YdS3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)