UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TV4HfvYdplcJTcaMT9rzMaC+/k3/pMoWLFfQIpl8lGY='
WHERE
key_id = 'dfbcc4995e2bd371392f1670dd035af1c95bfbaa8b5a7d8800d7068d51f92afe'
AND (
token = 'TV4HfvYdplcJTcaMT9rzMaC+/k3/pMoWLFfQIpl8lGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)