UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DZ7dgvpAUUJGTH4uDNJobOkOJoxBI8Pj7y+AVDzv7AY='
WHERE
key_id = '200f6a66fa4f7df3ab4acd541ca298c7691f0654db5eeb5af208af97478f430c'
AND (
token = 'DZ7dgvpAUUJGTH4uDNJobOkOJoxBI8Pj7y+AVDzv7AY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)