UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gEGz7kmJ/+Pf+5jE5COGU63Tu9Cn01B+bjWOdabo5DA='
WHERE
key_id = 'db5f6bc6bd88563814bfeee62047f90e8ed9da5c054e6c078e8dfdf3f25ca450'
AND (
token = 'gEGz7kmJ/+Pf+5jE5COGU63Tu9Cn01B+bjWOdabo5DA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)