UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3jNAotL93I0XmOewAPR7n62hUnM4a19W141ZrTscD3k='
WHERE
key_id = '049598f08c908c133ea596fd0f34d9a3b10d447638951d4b06a7f4dfc8bd610e'
AND (
token = '3jNAotL93I0XmOewAPR7n62hUnM4a19W141ZrTscD3k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)