UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CPY1S6GT/sIhJ5HdW8jz7/Fo9uw00zP2J1b4abRoHRg='
WHERE
key_id = 'c7bd35c2b091f2033b7ff72b4f9f227d7b34c31b750650ecfce21a90ef0f089d'
AND (
token = 'CPY1S6GT/sIhJ5HdW8jz7/Fo9uw00zP2J1b4abRoHRg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)