UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+aROjSb5X0FMLXs+kTzHb90cwQeKGf3Nd3Cd8QoG9dA=' 
WHERE 
  key_id = '50cb4b72dd2a6d4415e5f9fe0660e1e9aa6baf2af56c1ec91558f3c032dc0a9f' 
  AND (
    token = '+aROjSb5X0FMLXs+kTzHb90cwQeKGf3Nd3Cd8QoG9dA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034