UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0aFAHThI5r8UJ+JoPuQtMN3wN0QwZk61+b1fxkj6avQ=' 
WHERE 
  key_id = '46baa1d60d5c2ff722e588741d707ab91bc1b00fb485c6bf0db039f911f33208' 
  AND (
    token = '0aFAHThI5r8UJ+JoPuQtMN3wN0QwZk61+b1fxkj6avQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023