UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AaziElu6rT1vg/Qr0zTQ2ZgbNbGKETQc6mPyruUd7NE=' 
WHERE 
  key_id = '271cb5e7b84e096935a2a0c1dc85b23465cb6fb9c363b85ab37b4fb86cd647fc' 
  AND (
    token = 'AaziElu6rT1vg/Qr0zTQ2ZgbNbGKETQc6mPyruUd7NE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040