UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '15TLTOJx2jyqysdmGdfQUPjBEshuMESHbOwznGYm3OI='
WHERE
key_id = 'b077129726799120a5679a431e7c14b2e264aa4869a3af8f9fa331f9f06454c8'
AND (
token = '15TLTOJx2jyqysdmGdfQUPjBEshuMESHbOwznGYm3OI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)