UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3v43drmRs1VxSkqzTXy9psUGMaS/FMZkxLB8KMuXTV0='
WHERE
key_id = 'c3e83bb3e667c776af4190e959a35e7b3b1bedaaf1f30af62c7f81321c66eaab'
AND (
token = '3v43drmRs1VxSkqzTXy9psUGMaS/FMZkxLB8KMuXTV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)