UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WcZB89MWwINTltRZ+4IY3JgdEXK/veBXId+EWrAyL14='
WHERE
key_id = 'e2d3cdfe503419c7b60dbbc2375f11fc37ad79872d6ca8e4374e195444e84123'
AND (
token = 'WcZB89MWwINTltRZ+4IY3JgdEXK/veBXId+EWrAyL14='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)