UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EgEVQ42gkmyJiyqppSDVjkKi3jd3B1uPM4+vqoyp0Cs='
WHERE
key_id = 'eb340f023382b4c7f1b7032ecd385c2d7379c1e9ac7bbbbf46bd9b5833a43f44'
AND (
token = 'EgEVQ42gkmyJiyqppSDVjkKi3jd3B1uPM4+vqoyp0Cs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)