UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0PbUXiFHCyQXqgs9G2jZAznftGfYsUj5VxmUjoqiee0=' 
WHERE 
  key_id = '8fa393197e03f70031078aea803949f3852c10fc733f8d9e13aaf0d5452e66d1' 
  AND (
    token = '0PbUXiFHCyQXqgs9G2jZAznftGfYsUj5VxmUjoqiee0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028