UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JK+ffU2G+nl4YizqiQGwXTUjQAuOUM0/pCtTOlFzaHw='
WHERE
key_id = 'e4f0cfb80903515afa94084e73cd5a43dbfcf5ad77b67ef15e0664d557ebfd32'
AND (
token = 'JK+ffU2G+nl4YizqiQGwXTUjQAuOUM0/pCtTOlFzaHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)