UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O12WUhOoQUYmGKrghZX/DTz4udpCwgZdnj5wPMbOI5w='
WHERE
key_id = '55e73163359bd3b1c6a259a89ac82572d50dce6ba429304925d2a43ea30579dd'
AND (
token = 'O12WUhOoQUYmGKrghZX/DTz4udpCwgZdnj5wPMbOI5w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)