UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fOR9yVzKx1jsd8m7Ic82QiVXXBeTRA/zubEcXeM8EMg=' 
WHERE 
  key_id = '52529fdbb84b8f2117ebeabb047d7d5255dd833061b495af9afe428aecf367fc' 
  AND (
    token = 'fOR9yVzKx1jsd8m7Ic82QiVXXBeTRA/zubEcXeM8EMg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045