UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8TX53okiZt/JBv+6WPcP/YwNaZs0L0ZpLl/JEOvAfjo=' 
WHERE 
  key_id = '838c331b581bc27b72f3e2dcbf2bf0ae36650e5a1e79e00b2a05c4a4f4ad6d16' 
  AND (
    token = '8TX53okiZt/JBv+6WPcP/YwNaZs0L0ZpLl/JEOvAfjo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015