UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wlmnijn1l7sVDR6rqGFgHjWrY467+iccrZBzKe9BeEE='
WHERE
key_id = '29bc75ada7f437558a0efe0b30abe255456a5632213705d34c299261def87efe'
AND (
token = 'wlmnijn1l7sVDR6rqGFgHjWrY467+iccrZBzKe9BeEE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)