UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qe5+Qa6AfaWO/J0cSwvVQtBbr+J7gSxh1Ud6X4cbjDI='
WHERE
key_id = 'df549d113c33f347323e76753b7b70ad0ef93d206da6e518afaa4a8249cdd642'
AND (
token = 'Qe5+Qa6AfaWO/J0cSwvVQtBbr+J7gSxh1Ud6X4cbjDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)