UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J9s9qCEOfFAHP5fdcPsgvt9yUj2Fwpel2rRW0Hmgdwc='
WHERE
key_id = '672e3b6de4a315b46a1940e1bd92676820237b5e7e35f4072049e599ebc9c771'
AND (
token = 'J9s9qCEOfFAHP5fdcPsgvt9yUj2Fwpel2rRW0Hmgdwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)