UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J1KCVu3ZPUtS3XkZR0Tw+3NHSudJMWRFYfDJIaY0vUc=' 
WHERE 
  key_id = '2d76d40fb9740887af2a6cb24fc4456e73ad26f94fb0ba7a69ee6f1654adfa6a' 
  AND (
    token = 'J1KCVu3ZPUtS3XkZR0Tw+3NHSudJMWRFYfDJIaY0vUc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027