UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+BcoRK4Q5NdydTe6EbnoW/6jBlhO/j/zUapSFfT8C9E='
WHERE
key_id = '2ee86578f36e954738294d1c83852d82f950c58cfa1d556356ba9f30c2bc3724'
AND (
token = '+BcoRK4Q5NdydTe6EbnoW/6jBlhO/j/zUapSFfT8C9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)