UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YKvlyWO8UoV5Hwhi3SHoH0qZxEIjB8A4NPvzwPz/8cA=' 
WHERE 
  key_id = 'b6c0ed26449cd86869914bdcddde7d647cbbd7a990e510c15249b04c67fe1bd6' 
  AND (
    token = 'YKvlyWO8UoV5Hwhi3SHoH0qZxEIjB8A4NPvzwPz/8cA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035