UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YQB5/wVZaiJhaDHF+ZJHuNy/p0TrSPY9T17WSSuNbkA=' 
WHERE 
  key_id = '1fa6264c64ab54c0cca03a706881220d4f81c08b7eb891fb07a060afd42d7bbf' 
  AND (
    token = 'YQB5/wVZaiJhaDHF+ZJHuNy/p0TrSPY9T17WSSuNbkA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034