UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lgUUG++A9nkUQopUNk19FqGgorXZrrrtJEf2/JkySvE=' 
WHERE 
  key_id = '114951c1fa07d703ff4f4451b35786196b9064ed51c9c92c305645ffe46a1d81' 
  AND (
    token = 'lgUUG++A9nkUQopUNk19FqGgorXZrrrtJEf2/JkySvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031