UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6AGUOnLtKlW41m5uI92zr++yHKgtTOaIHcTq8TxxweI='
WHERE
key_id = '424823c15bae76740a50c78209e4ffe4817346661cd33e4c386530ab1bec4ad3'
AND (
token = '6AGUOnLtKlW41m5uI92zr++yHKgtTOaIHcTq8TxxweI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)