UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xJaNJqSXo/sUH/yPO5+mTGhBAnz68zHtjM8Xw6+Oh5k='
WHERE
key_id = '2a3db2a1634dc503b265363d3b9a9c055c4699b01a2577ff75394e6dadd14ae0'
AND (
token = 'xJaNJqSXo/sUH/yPO5+mTGhBAnz68zHtjM8Xw6+Oh5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)