UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1/wxrej6Igo4FV1cZuyhucevwqlP0BW959MyeF3OqZo='
WHERE
key_id = 'ebef357134ebe87c70023bc17a25a8bd49b79f12a72142912691605f9a5c3abc'
AND (
token = '1/wxrej6Igo4FV1cZuyhucevwqlP0BW959MyeF3OqZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)