UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6Y0bolOEbm86mRuS/w34LSHIljHj7gqwWta0lxRNSJI=' 
WHERE 
  key_id = '8504dd98c15291cf8f5208c8447805c0a21bd0ea772f7f99e445963acd1f5480' 
  AND (
    token = '6Y0bolOEbm86mRuS/w34LSHIljHj7gqwWta0lxRNSJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027