UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bKQciArIdqG+CvLDBNwbVvjUrSjBzqbtNWWHZKf9yJ0='
WHERE
key_id = 'e9f272e2e850d233e699b532033a8a79d2dbabdb6204893d2141a56d466fd1fa'
AND (
token = 'bKQciArIdqG+CvLDBNwbVvjUrSjBzqbtNWWHZKf9yJ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)