UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hiJB1do5NXHdERW4RO/Sutm8JpssoscuHHqDcuj5KWY='
WHERE
key_id = 'e844986ef688e1efd33045d3390f41adf19fcf76783808ecb22aa88e77e4e193'
AND (
token = 'hiJB1do5NXHdERW4RO/Sutm8JpssoscuHHqDcuj5KWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)