UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VzZEew/Z1KWUmENxr6Q5GUML0GlUMWwHiUoe2s7OrqI=' 
WHERE 
  key_id = 'ad98be32a9637e31ea0ca59de6279f37cc97f9a64387bd2a56da40421f5e0ce3' 
  AND (
    token = 'VzZEew/Z1KWUmENxr6Q5GUML0GlUMWwHiUoe2s7OrqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024