UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j9i5EBgQOG2C3OPwgwIfpY55HLC6Itpp0zdzKUg/ZUQ=' 
WHERE 
  key_id = 'e25d22df72db2e2739f27d22d782a1ec34204131453847fa73ed994a5a262dc2' 
  AND (
    token = 'j9i5EBgQOG2C3OPwgwIfpY55HLC6Itpp0zdzKUg/ZUQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031