UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iMvv3eD/1K+bjKv/uwyL5tJH/xyLnUXsR2SV1T7V9Lc='
WHERE
key_id = 'a08a7cd885d77521ffa6b88fe1cf807a8f180d089d1b93d8188bde00215b537d'
AND (
token = 'iMvv3eD/1K+bjKv/uwyL5tJH/xyLnUXsR2SV1T7V9Lc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)