UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1yM+pnaOCMGREWPVsACsy+tSZ2w/5r+SwJxzpRGdVyg=' 
WHERE 
  key_id = '186cab4b194430ed3f5d8f2a06e4296d161f3f6dea8fd89dfbbd1a267efb2515' 
  AND (
    token = '1yM+pnaOCMGREWPVsACsy+tSZ2w/5r+SwJxzpRGdVyg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019