UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A3dO/VlkRWZ+hYgA6czcH5J12fVkAGZiOACSVXjelvw='
WHERE
key_id = '98679067e3d2ac4114ea0d2da1caa805d282f438a43f110936cd23759065b981'
AND (
token = 'A3dO/VlkRWZ+hYgA6czcH5J12fVkAGZiOACSVXjelvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)