UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'erNfZp9OJebiiccvRF8E89GoNTazc/sERD8oeM8ER2U='
WHERE
key_id = '60c7f5fd97fed6e69300837cde1bad98b0877321a1b873c43c4d812bf80d949d'
AND (
token = 'erNfZp9OJebiiccvRF8E89GoNTazc/sERD8oeM8ER2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)