UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'swK5zv6S0Qk3K7qxfLsFKre3adLr8QmXHe4Ukb/DMqg=' 
WHERE 
  key_id = '11556bc8b0da940d38e6f9d19651dce9ba0f7bf105055390a5996f09b71b0f8c' 
  AND (
    token = 'swK5zv6S0Qk3K7qxfLsFKre3adLr8QmXHe4Ukb/DMqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034